Produced by Araxis Merge on 2020-08-14 00:01:30 +0000. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | Porto v3.2.3/Magento 2.x/Porto Theme/app/code/Mageplaza/LayeredNavigation/Controller/Search/Result | Index.php | 2017-05-16 11:25:12 +0000 |
| 2 | 2020-08-14 00:01:30 +0000 |
| Description | Between Files 1 and 2 | |
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 0 | 0 |
| Removed | 1 | 142 |
| Whitespace | Consecutive whitespace is treated as a single space |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
| Active line-pairing rules |
No regular expressions were active.
| 1 | <?php | |||||
| 2 | /** | |||||
| 3 | * Mageplaza | |||||
| 4 | * | |||||
| 5 | * NOTICE OF LICENSE | |||||
| 6 | * | |||||
| 7 | * This source file is subject to the Mageplaza.com license that is | |||||
| 8 | * available through the world-wide-web at this URL: | |||||
| 9 | * https://www.mageplaza.com/LICENSE.txt | |||||
| 10 | * | |||||
| 11 | * DISCLAIMER | |||||
| 12 | * | |||||
| 13 | * Do not edit or add to this file if you wish to upgrade this extension to newer | |||||
| 14 | * version in the future. | |||||
| 15 | * | |||||
| 16 | * @category Mageplaza | |||||
| 17 | * @package Mageplaza_LayeredNavigation | |||||
| 18 | * @copyright Copyright (c) 2017 Mageplaza (http://www.mageplaza.com/) | |||||
| 19 | * @license https://www.mageplaza.com/LICENSE.txt | |||||
| 20 | */ | |||||
| 21 | ||||||
| 22 | namespace Mageplaza\LayeredNavigation\Controller\Search\Result; | |||||
| 23 | ||||||
| 24 | use Magento\Catalog\Model\Layer\Resolver; | |||||
| 25 | use Magento\Catalog\Model\Session; | |||||
| 26 | use Magento\Framework\App\Action\Context; | |||||
| 27 | use Magento\Search\Model\QueryFactory; | |||||
| 28 | use Magento\Store\Model\StoreManagerInterface; | |||||
| 29 | ||||||
| 30 | /** | |||||
| 31 | * Class Index | |||||
| 32 | * @package Mageplaza\LayeredNavigation\Controller\Search\Result | |||||
| 33 | */ | |||||
| 34 | class Index extends \Magento\Framework\App\Action\Action | |||||
| 35 | { | |||||
| 36 | » /** | |||||
| 37 | » * Catalog session | |||||
| 38 | » * | |||||
| 39 | » * @var Session | |||||
| 40 | » */ | |||||
| 41 | » protected $_catalogSession; | |||||
| 42 | ||||||
| 43 | » /** | |||||
| 44 | » * @var StoreManagerInterface | |||||
| 45 | » */ | |||||
| 46 | » protected $_storeManager; | |||||
| 47 | » /** | |||||
| 48 | » * @type \Magento\Framework\Json\Helper\Data | |||||
| 49 | » */ | |||||
| 50 | » protected $_jsonHelper; | |||||
| 51 | » /** | |||||
| 52 | » * @type \Mageplaza\LayeredNavigation\Helper\Data | |||||
| 53 | » */ | |||||
| 54 | » protected $_moduleHelper; | |||||
| 55 | » /** | |||||
| 56 | » * @type \Magento\CatalogSearch\Helper\Data | |||||
| 57 | » */ | |||||
| 58 | » protected $_helper; | |||||
| 59 | » /** | |||||
| 60 | » * @var QueryFactory | |||||
| 61 | » */ | |||||
| 62 | » private $_queryFactory; | |||||
| 63 | » /** | |||||
| 64 | » * Catalog Layer Resolver | |||||
| 65 | » * | |||||
| 66 | » * @var Resolver | |||||
| 67 | » */ | |||||
| 68 | » private $layerResolver; | |||||
| 69 | ||||||
| 70 | » /** | |||||
| 71 | » * @param \Magento\Framework\App\Action\Context $context | |||||
| 72 | » * @param \Magento\Catalog\Model\Session $catalogSession | |||||
| 73 | » * @param \Magento\Store\Model\StoreManagerInterface $storeManager | |||||
| 74 | » * @param \Magento\Search\Model\QueryFactory $queryFactory | |||||
| 75 | » * @param \Magento\Catalog\Model\Layer\Resolver $layerResolver | |||||
| 76 | » * @param \Magento\CatalogSearch\Helper\Data $helper | |||||
| 77 | » * @param \Magento\Framework\Json\Helper\Data $jsonHelper | |||||
| 78 | » * @param \Mageplaza\LayeredNavigation\Helper\Data $moduleHelper | |||||
| 79 | » */ | |||||
| 80 | » public function __construct( | |||||
| 81 | » » Context $context, | |||||
| 82 | » » Session $catalogSession, | |||||
| 83 | » » StoreManagerInterface $storeManager, | |||||
| 84 | » » QueryFactory $queryFactory, | |||||
| 85 | » » Resolver $layerResolver, | |||||
| 86 | » » \Magento\CatalogSearch\Helper\Data $helper, | |||||
| 87 | » » \Magento\Framework\Json\Helper\Data $jsonHelper, | |||||
| 88 | » » \Mageplaza\LayeredNavigation\Helper\Data $moduleHelper | |||||
| 89 | » ) | |||||
| 90 | » { | |||||
| 91 | » » parent::__construct($context); | |||||
| 92 | » » $this->_storeManager = $storeManager; | |||||
| 93 | » » $this->_catalogSession = $catalogSession; | |||||
| 94 | » » $this->_queryFactory = $queryFactory; | |||||
| 95 | » » $this->layerResolver = $layerResolver; | |||||
| 96 | » » $this->_jsonHelper = $jsonHelper; | |||||
| 97 | » » $this->_moduleHelper = $moduleHelper; | |||||
| 98 | » » $this->_helper = $helper; | |||||
| 99 | » } | |||||
| 100 | ||||||
| 101 | » /** | |||||
| 102 | » * Display search result | |||||
| 103 | » * | |||||
| 104 | » * @return void | |||||
| 105 | » */ | |||||
| 106 | » public function execute() | |||||
| 107 | » { | |||||
| 108 | » » $this->layerResolver->create(Resolver::CATALOG_LAYER_SEARCH); | |||||
| 109 | » » /* @var $query \Magento\Search\Model\Query */ | |||||
| 110 | » » $query = $this->_queryFactory->get(); | |||||
| 111 | ||||||
| 112 | » » $query->setStoreId($this->_storeManager->getStore()->getId()); | |||||
| 113 | ||||||
| 114 | » » if ($query->getQueryText() != '') { | |||||
| 115 | » » » if ($this->_helper->isMinQueryLength()) { | |||||
| 116 | » » » » $query->setId(0)->setIsActive(1)->setIsProcessed(1); | |||||
| 117 | » » » } else { | |||||
| 118 | » » » » $query->saveIncrementalPopularity(); | |||||
| 119 | ||||||
| 120 | » » » » if ($query->getRedirect()) { | |||||
| 121 | » » » » » $this->getResponse()->setRedirect($query->getRedirect()); | |||||
| 122 | ||||||
| 123 | » » » » » return; | |||||
| 124 | » » » » } | |||||
| 125 | » » » } | |||||
| 126 | ||||||
| 127 | » » » $this->_helper->checkNotes(); | |||||
| 128 | ||||||
| 129 | » » » if ($this->_moduleHelper->isEnabled() && $this->getRequest()->isAjax()) { | |||||
| 130 | » » » » $navigation = $this->_view->getLayout()->getBlock('catalogsearch.leftnav'); | |||||
| 131 | » » » » $products = $this->_view->getLayout()->getBlock('search.result'); | |||||
| 132 | » » » » $result = ['products' => $products->toHtml(), 'navigation' => $navigation->toHtml()]; | |||||
| 133 | » » » » $this->getResponse()->representJson($this->_jsonHelper->jsonEncode($result)); | |||||
| 134 | » » » } else { | |||||
| 135 | » » » » $this->_view->loadLayout(); | |||||
| 136 | » » » » $this->_view->renderLayout(); | |||||
| 137 | » » » } | |||||
| 138 | » » } else { | |||||
| 139 | » » » $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl()); | |||||
| 140 | » » } | |||||
| 141 | » } | |||||
| 142 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993–2019 Araxis Ltd (www.araxis.com). All rights reserved.